package app;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author AlexTien
 * @version currentVersion
 * @package app
 * @description
 * @createtime 17/7/7 上午11:50
 */

@RestController
public class Controller {
    @Value("${words}") String words;

    @RequestMapping("/")
    public String getWords(){
        String[] wordArray = words.split(",");
        int i = (int)Math.round(Math.random() * (wordArray.length - 1));
        return wordArray[i];
    }
}
